﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _04抽象工厂
{
    public class User
    {
        public string  Name { get; set; }
        public int Id { get; set; }
    }

    public interface IDatabaseUser
    {
        void InsertUser(User user);
        User GetUser(int id);
    }
    public class SqlServerUser: IDatabaseUser
    {
        public void InsertUser(User user)
        {
            Console.WriteLine($"插入了SqlServerUser:{user.Name}");
        }
        public User GetUser(int id)
        {
            Console.WriteLine($"获取了Id：{id}的用户");
            return null;
        }
    }

    public class MysqlUser : IDatabaseUser
    {
        public void InsertUser(User user)
        {
            Console.WriteLine($"插入了MysqlUser:{user.Name}");
        }
        public User GetUser(int id)
        {
            Console.WriteLine($"获取了Id：{id}的用户");
            return null;
        }
    }
    public class SqlliteUser : IDatabaseUser
    {
        public void InsertUser(User user)
        {
            Console.WriteLine($"插入了MysqlrUser:{user.Name}");
        }
        public User GetUser(int id)
        {
            Console.WriteLine($"获取了Id：{id}的用户");
            return null;
        }
    }

    
}
